<template>
    <view :style="objColor">
        <!-- components/upgrading/upgrading.wxml -->
        <view class="imagesize">
            <image class="upgrading" :src="icon" mode="aspectFit" :style="iconStyle"></image>
        </view>
        <view class="txt">
            <view class="txt0" v-if="text2">{{ text2 }}</view>
            <view class="txt1" v-if="code === '500'">{{ text }}</view>
            <view class="txt1" v-if="type === 'location'">{{ text }}</view>
            <view class="txt2">{{ text1 }}</view>

            <view class="location_btn" v-if="type === 'location'" @tap="goArea">
                <text class="l_text">手动选择城市</text>
            </view>

            <!-- <view class="txt2">我们将尽快恢复服务，给您造成的不便，敬请谅解~</view> -->
            <view class="btn" @tap="goBack" v-if="code">{{code === '-1'?'刷新':'回到上一页'}}</view>
        </view>
    </view>
</template>

<script lang="ts">
	// 'use strict'; // components/upgrading/upgrading.ts

	export default {
		data() {
			return {};
		},
		/**
		 * 组件的属性列表
		 */
		props: {
			icon: {
				type: String,
				default: 'https://oos-cn.ctyunapi.cn/front-end/static/static/upgrading1.png'
			},
			text: {
				type: String,
				default: '系统正在升级维护中'
			},
			text1: {
				type: String,
				default: '暂无数据！'
			},
            text2: {
				type: String,
				default: ''
			},
			iconStyle:{
				type: String,
				default: ''
			},
      code:{
	      type: String,
	      default: ''
      },
			type:{
				type: String,
				default: ''
			}
		},
		/**
		 * 组件的方法列表
		 */
		methods: {
			goBack(){
				uni.navigateBack({delta: 2})
      },

            //去城市选择页面
            goArea(){
                uni.navigateTo({
                    url: '/homeSub/pages/area/area'
                });
            },

            
    }
	};
</script>
<style lang="less" scoped>
    @import "../../commin/commin.less";

    .imagesize {
        display: flex; //flex布局
        height: 900rpx; //flex布局高度
        justify-content: center;
        align-items: center;
        padding-bottom: 20rpx;

        .upgrading {
            width: 514rpx;
            height: 398rpx;
        }

    }

    .txt {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0 auto;
        text-align: center;
        margin-top: -190rpx;
        padding-bottom: 140rpx;
        width: 72%;
    }

    .txt1 {
        .fontsize(32rpx);
        font-family: PingFang SC;
        font-weight: 500;
        color: @blue;
        margin-bottom: 24rpx;
    }

    .txt2 {
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #909399;
    }
    .btn{
        padding: 10rpx 20rpx;
        border:1rpx solid #909399;
        border-radius: 15rpx;
        color: #909399;
        font-size: 26rpx;
        margin-top: 60rpx;
    }
    .txt0{
        font-size: 30rpx;   
        font-weight: 400;
        color: #18181A;
        margin-bottom: 20rpx;
    }

    .location_btn{
        margin-top: 63rpx;
        width: 200rpx;
        height: 68rpx;
        line-height: 60rpx;
        border-radius: 10rpx 10rpx 10rpx 10rpx;
        border: 1rpx solid @blue;;
        .l_text{
            font-size: 24rpx;
            font-family: PingFang SC-Medium, PingFang SC;
            font-weight: 400;
            color: @blue;
        }
    }
    
</style>
